package com.ruoqing.utils.common;

import com.ruoqing.core.constant.Constants;
import com.ruoqing.core.dto.BaseResponse;

/**
	* @author YaoXian
	* @title: ResultJudgeUtil
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 通用模块 - 工具类模块 - 响应结果判断
	* @date 2020-12-06 16:17
	*/
public class ResultJudgeUtil {
		
		private Object result;
		
		public static BaseResponse baseResultJudge(Object result){
				String status;
				if (result instanceof Integer){
						if ((Integer)result>0){
								status = Constants.responseOk;
						}else {
								status = Constants.responseError;
						}
				}else {
						status = Constants.responseError;
				}
				return BaseResponse.buildResponse(status);
		}
}
